﻿using ConfExpert.Forms.Base;
using DevExpress.XtraEditors;
using System;
using System.IO;
using System.Text;

namespace ConfExpert.Forms
{
    public partial class Scope : XForm
    {
        public Scope()
        {
            InitializeComponent();
        }

        private void Scope_Load(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();


            //        using (StreamReader sr = new StreamReader(txtName))
            int NrOfFiles = 0;
            using (StreamWriter outfile = new StreamWriter(@"E:\AllCsFiles.txt"))
            foreach (string file in Directory.GetFiles(@"C:\CodePlex\confexpert\", "*.cs", SearchOption.AllDirectories))
                if (!file.Contains("MyData") &&
                    !file.Contains("DS") &&
                    !file.EndsWith("Excluded.cs") &&
                    !file.EndsWith("Designer.cs"))
                {
                    NrOfFiles++;
                    sb.Append(File.ReadAllText(file));
                    outfile.WriteLine(file.ToString());
                }

            string strResult = sb.ToString();
            XtraMessageBox.Show(NrOfFiles.ToString());

            //ExecuteNonQuery("UpdScope", strResult);

        }
    }
}
